
filebeat-tar-install:
    file.managed: #cp文件到minion端
        - name: /usr/local/src/filebeat-6.4.0-x86_64.rpm
        - source: salt://files/filebeat-6.4.0-x86_64.rpm
        - user: root
        - group: root
        - mode: 644

    cmd.run: #执行本地命令
        - name: rpm -ivh  /usr/local/src/filebeat-6.4.0-x86_64.rpm
        - unless: rpm -q filebeat
        - require:
            - file: /usr/local/src/filebeat-6.4.0-x86_64.rpm


filebeat-config:
    file.managed:
        - name: /etc/filebeat/filebeat.yml
        - source: salt://files/filebeat.yml
        - user: root
        - group: root
        - mode: 644

filebeat-run:
    service:
    - name: filebeat
    - running
    - reload: True
    - watch:
       - file: /etc/filebeat/filebeat.yml

